﻿//********************************************************************************//
//创建日期：<创建日期，2016-03-31>
//创建作者：<郭登杰，guodengjie@shanghai3h.com>
//功能说明：处理账单相关
//********************************************************************************//

using System.Collections.Generic;
using Newtonsoft.Json;
using Entity;
using YXYLCommon;
using System.Web;
using System.Web.SessionState;

namespace Web.ashx.QSQT
{
    public class TongZhiS : IHttpHandler, IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            if (context.Request["op"] == "UPDATECAIWUBM")
            {
                string yhh=context.Request["yhh"];
                string cwbm=context.Request["cwbm"];
                DbCmdResult dbrs = new DALQSQTTongZhiS().UpdateCWBM(yhh, cwbm, LoginInfo.CurrentUser.UserID.ToString());
                context.Response.Write(JsonConvert.SerializeObject(new JsonRs(dbrs.IsSuccess,dbrs.ReturnMsg,null)));
            }
            else
            {
                int type = int.Parse(context.Request["type"]);
                int ym = int.Parse(context.Request["ym"]);
                int sl = int.Parse(context.Request["sl"]);
                string bm = context.Request["bm"];
                string printdate = context.Request["printdate"];
                string returndate = context.Request["returndate"];
                List<QSQTTongZhiS> list = new DALQSQTTongZhiS().Get(type, ym, sl, bm, printdate, returndate);
                context.Response.Write(JsonConvert.SerializeObject(list));
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}